import request from '@/utils/request'

// 查询领料申请列表
export function listMaterialRequisition(query) {
  return request({
    url: '/mes/materialRequisition/list',
    method: 'get',
    params: query
  })
}

// 查询领料申请列表
export function getSelectOption() {
  return request({
    url: '/mes/materialRequisition/selectOption',
    method: 'get'
  })
}

// 查询产品所需要的物料
export function getProductInfo(id) {
  return request({
    url: '/mes/materialRequisition/productInfo/' + id,
    method: 'get'
  })
}

// 查询领料申请详细
export function getMaterialRequisition(id) {
  return request({
    url: '/mes/materialRequisition/' + id,
    method: 'get'
  })
}

// 新增领料申请
export function addMaterialRequisition(data) {
  return request({
    url: '/mes/materialRequisition',
    method: 'post',
    data: data
  })
}

// 修改领料申请
export function updateMaterialRequisition(data) {
  return request({
    url: '/mes/materialRequisition',
    method: 'put',
    data: data
  })
}

// 删除领料申请
export function delMaterialRequisition(id) {
  return request({
    url: '/mes/materialRequisition/' + id,
    method: 'delete'
  })
}

// 导出领料申请
export function exportMaterialRequisition(query) {
  return request({
    url: '/mes/materialRequisition/export',
    method: 'get',
    params: query
  })
}
